#include "map.h"
using namespace mapscreen;
//the drawing instructions for the terrain pixel
terrainpixel::terrainpixel(mapdata::terrain* t){
    ter = t;
}
void terrainpixel::draw(int x, int y, Cairo::RefPtr<Cairo::Context> ct){
    ct->save();
    ct->set_source_rgb(1, 1, .2);
    switch(ter->gType()){
        case mapdata::astr:
            ct->arc(x * pixWid, y * pixHgt, 20, 0, 2*3.14159);
            break;
        case mapdata::debris:
            ct->rectangle(x * pixWid + 5, y * pixHgt + 5, 10, 10);
            ct->rectangle(x * pixWid - 15, y * pixHgt - 15, 10, 10);
            break;
        case mapdata::neb:
            ct->rectangle((x * pixWid) - (pixWid / 2), (y * pixHgt) - (pixHgt / 2), pixWid, pixHgt);
            break;
    }
    ct->stroke();
    ct->restore();
}
bool terrainpixel::compare(mapdata::terrain* t){
    return t == ter;
}